﻿using System;
using System.Collections.Generic;
using System.Text;
using MCromwell.StaffIntranet.Task.Tasks;
using MCromwell.StaffIntranet.DTO;
using MCromwell.StaffIntranet.DependencyInjection;

namespace MCromwell.StaffIntranet.Presenters
{
    public class StaffDeletionPresenter
    {
        private IStaffManagementTask managementTask;
        private IStaffDeletionView deletionView;

        public StaffDeletionPresenter(IStaffManagementTask managementTask, IStaffDeletionView deletionView)
        {

            if (managementTask == null)
                throw new ArgumentNullException("managementTask", "managementTask cannot be null");

            if (deletionView == null)
                throw new ArgumentNullException("deletionView", "deletionView cannot be null");

            this.managementTask = managementTask;
            this.deletionView = deletionView;
        }

        public StaffDeletionPresenter(IStaffDeletionView deletionView)
            : this(IoC.Resolve<IStaffManagementTask>(), deletionView)
        {
        }

        public void DeleteStaff(int StaffId)
        {
            managementTask.DeleteStaffBy(StaffId);
        }
    }
}
